package com.example.demo.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author :蕉绿
 * @Date : 2023/2/16 19:15
 * @Version : V1.0
 * @Description :
 */

@Controller
@ResponseBody
public class UserController {
    private static final Logger logger = LoggerFactory.getLogger(UserController.class);

    @RequestMapping("/logger")
    public String sayHi() {

        //写日志
        logger.debug("debug!");
        logger.error("error!");
        logger.info("info!");
        logger.warn("warn!");
        logger.trace("trace!");
        return "hi! SpringBoot";
    }
}
